home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
090
/
pctj0987.arc
/
PAGESIZE.C
< prev
next >
Wrap
Text File
|
1987-07-02
|
3KB
|
107 lines
/*
* PAGESIZE -- PC Tech Journal Laser Printer Page Size Test
*
* Version 1.0
*
* Copyright (c) 1987, Ziff Communications Company
* Program by: Rainer McCown
*
* This program determines the printable page size by positioning
* the cursor and then printing a character. The HP LaserJets
* will print the numbers through 7 (on the top, right, and bottom
* sides) the others are off of the page. The locations beyond
* the left margin are negative and cannot be addressed which
* shoves the higher numbers back onto the page.
*/
#define STD_OUT 1
extern void sndl(char [], int),
snd (char []),
setbinary(int);
/******************************* MAIN *******************************/
void main()
{
/* Change STD_OUT to binary mode to avoid
converting LFs to CR,LF and to avoid
stopping on EOFs */
setbinary(STD_OUT);
/* Initialize the printer */
snd("\x1BE"); /* Reset the printer */
snd("\x1B&l0E"); /* Zero the top margin */
snd("\x1B&s1C"); /* Disable EOL wrap */
snd("\x1B9"); /* Clear margins */
snd("\x1B&l0O"); /* Landscape mode */
/* Look for top edge */
snd("\x1B*p500x230Y@");
snd("\x1B*p+100x-20Y1");
snd("\x1B*p+100x-20Y2");
snd("\x1B*p+100x-20Y3");
snd("\x1B*p+100x-20Y4");
snd("\x1B*p+100x-20Y5");
snd("\x1B*p+100x-20Y6");
snd("\x1B*p+100x-10Y7");
snd("\x1B*p+100x-10Y8");
snd("\x1B*p+100x-10Y9");
snd("\x1B*p+100x-10Y0");
/* Look for bottom edge */
snd("\x1B*p500x3090Y#");
snd("\x1B*p+100x+20Y1");
snd("\x1B*p+100x+20Y2");
snd("\x1B*p+100x+20Y3");
snd("\x1B*p+100x+20Y4");
snd("\x1B*p+100x+20Y5");
snd("\x1B*p+100x+20Y6");
snd("\x1B*p+100x+10Y7");
snd("\x1B*p+100x+10Y8");
snd("\x1B*p+100x+10Y9");
snd("\x1B*p+100x+10Y0");
/* Look for left edge */
snd("\x1B*p130x500Y$");
snd("\x1B*p-50x+100Y1");
snd("\x1B*p-50x+100Y2");
snd("\x1B*p-50x+100Y3");
snd("\x1B*p-50x+100Y4");
snd("\x1B*p-50x+100Y5");
snd("\x1B*p-50x+100Y6");
snd("\x1B*p-40x+100Y7");
snd("\x1B*p-40x+100Y8");
snd("\x1B*p-40x+100Y9");
snd("\x1B*p-40x+100Y0");
/* Look for right edge */
snd("\x1B*p2240x500Y%");
snd("\x1B*p-10x+100Y1");
snd("\x1B*p-10x+100Y2");
snd("\x1B*p-10x+100Y3");
snd("\x1B*p-10x+100Y4");
snd("\x1B*p-10x+100Y5");
snd("\x1B*p-10x+100Y6");
snd("\x1B*p-20x+100Y7");
snd("\x1B*p-20x+100Y8");
snd("\x1B*p-20x+100Y9");
snd("\x1B*p-20x+100Y0");
/* Eject page */
snd("\f");
} /* End MAIN */